<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>试卷列表</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/css/style.min.css}">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>试卷列表</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table table-striped table-bordered table-hover dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>试卷名称</th>
                                            <th>开始时间</th>
                                            <th>结束时间</th>
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr th:each="paper : ${list}">
                                            <td th:text="${paper.name}"></td>
                                            <td th:text="${#dates.format(paper.startTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                                            <td th:text="${#dates.format(paper.endTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                                            <td>
                                                <span th:if="${paper.status == '0'}" class="label label-warning">未开始</span>
                                                <span th:if="${paper.status == '1'}" class="label label-primary">进行中</span>
                                                <span th:if="${paper.status == '2'}" class="label label-danger">已结束</span>
                                                <span th:if="${paper.status == '11'}" class="label label-success">已完成</span>
                                            </td>
                                            <td>
                                                <a th:if="${paper.status != '11'}" class="btn btn-primary btn-sm" 
                                                   th:href="@{/jxsx/paper/exam(paperId=${paper.paperId})}">
                                                    <i class="fa fa-edit"></i> 进入考试
                                                </a>
                                                <a th:if="${paper.status == '11'}" class="btn btn-info btn-sm" 
                                                   th:href="@{/jxsx/paper/detail(paperId=${paper.paperId})}">
                                                    <i class="fa fa-eye"></i> 查看
                                                </a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/plugins/dataTables/jquery.dataTables.js}"></script>
    <script th:src="@{/js/plugins/dataTables/dataTables.bootstrap.js}"></script>
    <script>
        $(document).ready(function(){
            $('.dataTables-example').dataTable();
        });
    </script>
</body>
</html> 